package com.dcy.znoa.domain.sys;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;

/**
 * 角色表
 * @author chenjie
 * @modify pengyu 增加了  is_manager 字段，一般不允许删除
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("sys_role")
public class Role {


	@TableId(type = IdType.AUTO, value = "role_id")
    Long roleId;
	
	@TableField("role_name")
    String roleName;

	@TableField("describe")
    String describe;
	
    @TableField("comp_id")
    Long compId;
    
    @TableField("comp_name")
    String compName;
    
    @TableField("create_oper_id")
    Long createOperId;

    @TableField("create_time")
    Date createTime;

    @TableField("update_oper_id")
    Long updateOperId;

    @TableField("update_time")
    Date updateTime;

    @TableField("valid_flag")
    Integer validFlag;

    @TableField("is_manager")
    Integer isManager;// 是否为企业管理员,默认 0 不是 1 是 数据库中 isManager + compId 唯一 索引。且 validFlag 一定 为 1

    public Role(Long compId, Integer isManager) {
        this.compId = compId;
        this.isManager = isManager;
    }

    public Role(String roleName, String describe, Long compId, String compName, Long createOperId, Date createTime, Integer validFlag, Integer isManager) {
        this.roleName = roleName;
        this.describe = describe;
        this.compId = compId;
        this.compName = compName;
        this.createOperId = createOperId;
        this.createTime = createTime;
        this.validFlag = validFlag;
        this.isManager = isManager;
    }
}
